package com.ruicar.afs.cloud.afscase.postloan.controller;

import com.ruicar.afs.cloud.afscase.postloan.service.CaseRepayPlanService;
import com.ruicar.afs.cloud.afscase.postloan.vo.CaseRepayPlanVO;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description
 * @Author Peng Jinbo
 * @Date 2020/08/15 15:55
 */
@Slf4j
@RestController
@RequestMapping("/plan")
@AllArgsConstructor
public class CaseRepayPlanController {

    /**
     * Case repay plan service
     */
    private CaseRepayPlanService caseRepayPlanService;

    /**
     * Author Peng Jinbo
     * List repay plans response
     *
     * @param applyNo apply no
     * @return the response
     */
    @GetMapping("/list")
    public IResponse<List<CaseRepayPlanVO>> listRepayPlans(@RequestParam("applyNo")String applyNo){
        return IResponse.success(caseRepayPlanService.listRepayPlans(applyNo));
    }

}
